#pragma once

#include <ctime>

class Timer
{
private:
	time_t start;
	time_t end;
	time_t elapsedTime;
	float every;

public:
	//constructor
	Timer()
	{
		start = 0;
		end = 0;
		elapsedTime = 0;
		every = FRAMERATE;
	}
	//custom constructor
	Timer( float a_every ): every( a_every )
	{
		start = 0;
		end = 0;
		elapsedTime = 0;
	}
	//destructor
	~Timer(){}

	void startClock()
	{
		start = clock();
		end = 0;
	}
	void stopClock()
	{
		end = clock();
		elapsedTime += end - start;
	}
	bool chkTime()
	{
		if( (elapsedTime/1000) >= every )
		{	
			start = 0;
			end = 0;
			elapsedTime = 0;
			return true;
		}
		else
			return false;
	}

};